
package net.w.newworld.item;

import net.w.newworld.creativetab.TabTabMCW;
import net.w.newworld.ElementsNewWorldMod;

import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.event.ModelRegistryEvent;

import net.minecraft.util.ResourceLocation;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.Item;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;

@ElementsNewWorldMod.ModElement.Tag
public class ItemChaosArmor extends ElementsNewWorldMod.ModElement {
	@GameRegistry.ObjectHolder("new_world:chaos_armorhelmet")
	public static final Item helmet = null;
	@GameRegistry.ObjectHolder("new_world:chaos_armorbody")
	public static final Item body = null;
	@GameRegistry.ObjectHolder("new_world:chaos_armorlegs")
	public static final Item legs = null;
	@GameRegistry.ObjectHolder("new_world:chaos_armorboots")
	public static final Item boots = null;
	public ItemChaosArmor(ElementsNewWorldMod instance) {
		super(instance, 42);
	}

	@Override
	public void initElements() {
		ItemArmor.ArmorMaterial enuma = EnumHelper.addArmorMaterial("CHAOS_ARMOR", "new_world:chaos", 700, new int[]{150, 200, 200, 150}, 30,
				(net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("")), 4f);
		elements.items.add(() -> new ItemArmor(enuma, 0, EntityEquipmentSlot.HEAD).setUnlocalizedName("chaos_armorhelmet")
				.setRegistryName("chaos_armorhelmet").setCreativeTab(TabTabMCW.tab));
		elements.items.add(() -> new ItemArmor(enuma, 0, EntityEquipmentSlot.CHEST).setUnlocalizedName("chaos_armorbody")
				.setRegistryName("chaos_armorbody").setCreativeTab(TabTabMCW.tab));
		elements.items.add(() -> new ItemArmor(enuma, 0, EntityEquipmentSlot.LEGS).setUnlocalizedName("chaos_armorlegs")
				.setRegistryName("chaos_armorlegs").setCreativeTab(TabTabMCW.tab));
		elements.items.add(() -> new ItemArmor(enuma, 0, EntityEquipmentSlot.FEET).setUnlocalizedName("chaos_armorboots")
				.setRegistryName("chaos_armorboots").setCreativeTab(TabTabMCW.tab));
	}

	@SideOnly(Side.CLIENT)
	@Override
	public void registerModels(ModelRegistryEvent event) {
		ModelLoader.setCustomModelResourceLocation(helmet, 0, new ModelResourceLocation("new_world:chaos_armorhelmet", "inventory"));
		ModelLoader.setCustomModelResourceLocation(body, 0, new ModelResourceLocation("new_world:chaos_armorbody", "inventory"));
		ModelLoader.setCustomModelResourceLocation(legs, 0, new ModelResourceLocation("new_world:chaos_armorlegs", "inventory"));
		ModelLoader.setCustomModelResourceLocation(boots, 0, new ModelResourceLocation("new_world:chaos_armorboots", "inventory"));
	}
}
